﻿//自定义新增方法
var type;
var Id;
var EntityName;
var fnCustomAdd = function () {
    type = 1;
    Id = "";
    EntityName = "V_CrmLayout";
    document.getElementById("EditUIWindow").src = "../Crm/Sale/AddLayout.aspx?ID=" + Id + "&type=" + type + "&entity=" + EntityName + "";
    YAHOO.example.container.dialog1.show();
}
//修改
var fnCustomEdit = function () {
    type = 2;
    var Deptid;
    Deptid = record.getData("DeptID");
    EntityName = "V_CrmLayout";
    document.getElementById("EditUIWindow").src = "../Crm/Sale/AddLayout.aspx?ID=" + Deptid + "&type=" + type + "&entity=" + EntityName + "";
    YAHOO.example.container.dialog1.show();
}


//查看
var fnCustomView = function () {
    type = 3;
    var Deptid;
    Deptid = record.getData("DeptID");
    EntityName = "V_CrmLayout";
    document.getElementById("EditUIWindow").src = "../Crm/Sale/AddLayout.aspx?ID=" + Deptid + "&type=" + type + "&entity=" + EntityName + "";
    YAHOO.example.container.dialog1.show();
//    ;
//    type = 3;
//    var Deptid;
//    Deptid = record.getData("DeptID");
//    EntityName = "V_CrmLayout";
//    document.getElementById("EditUIWindow").src = "../Crm/Sale/AddLayout.aspx?ID=" + Deptid + "&type=" + type + "&entity=" + EntityName + "";
//    YAHOO.example.container.dialog5.show();
    //    var editwindow = document.getElementById("EditUIWindow");
    //    if (editwindow) {
    //        setTimeout(editwindow.contentWindow.$("#form1").SeControlReadOnly(), 200);
    //    }   
}